package com.sg.business.visualization.labelprovider;

import com.sg.business.model.DummyModel;
import com.sg.widgets.commons.labelprovider.ConfiguratorColumnLabelProvider;

public abstract class AbstractOrgAmountProvider extends
		ConfiguratorColumnLabelProvider {

	@Override
	public String getText(Object element) {
		if (element instanceof DummyModel) {
			DummyModel dummyModel = (DummyModel) element;
			Object value = dummyModel.getValue(getFiled());
			if (value != null) {
				double result = Double.valueOf(Long.toString((long) value));
				result = result/10000;
				return String.format("%,.2f", result);
			}
		}
		return super.getText(element);
	}

	protected abstract String getFiled();
}
